package com.jiantong.user.enums;

/**
 *
 * Created by mz on 5/7/17.
 */
public enum AppUserRole {

    BREED_FACTORY_ADMIN(1,"养殖场管理员"),
    BREED_FACTORY_NORMAL(2,"养殖场操作员"),
    BUTCHER_FACTORY_ADMIN(3,"屠宰场管理员"),
    BUTCHER_FACTORY_NORMAL(4,"屠宰场操作员"),
    VETERINARIAN(5,"官方兽医"),
    ASSOCIATION_INSPECTOR(6,"协检员"),
    PREVENTION_COORDINATOR(7,"乡村防疫员"),
    CITY_INSPECTOR(8,"市级查看员"),
    COUNTY_INSPECTOR(9,"县级查看员"),
    UN_SCALE_BREED_FACTORY_COMMON(10,"散户账号"),

    /*
        执法办案相关角色
    */
    CASE_REGISTER(11,"执法办案登记员"),
    CASE_TRANSACT(12,"执法办案办案员"),
    CASE_APPROVAL(13,"执法办案审批员"),
    CASE_ADMINISTRATOR(14,"执法办案后台管理员");

    private final Integer value;
    private final String description;

    AppUserRole(Integer value, String description){
        this.value = value;
        this.description = description;
    }

    public static AppUserRole from(Integer value) {
        for (AppUserRole appUserRole : AppUserRole.values()) {
            if (appUserRole.value.equals(value)) {
                return appUserRole;
            }
        }
        return null;
    }

    public Integer value() {
        return this.value;
    }

    @Override
    public String toString() {
        return description;
    }
}
